package com.lk.mapper;

import com.lk.model.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : lk
 * @date 2021/11/20 17:21
 **/
@Mapper
public interface MenuMapper {


    @Select("select * from sys_menu  sm \n" +
            " join sys_role_menu srm \n" +
            "on sm.menu_id=srm.menu_id\n" +
            " join sys_user_role  sur \n" +
            "on srm.role_id=sur.role_id\n" +
            "where sur.user_id=#{userId} ")
    List<Menu> menuList(@Param("userId") Integer userId);

}
